Cap inherit_from recursion in DeploySpec::FileSystem - #1498
Open
aqeelvn wants to merge 1 commit into
Open
Conversation
An inherit_from cycle (a.yml <-> b.yml) recursed until SystemStackError -- which is not a StandardError, so it escaped every rescue in the callers -- or, with the CacheDeploySpecJob execution cap, burned a worker thread for 15 minutes. Raise a clear DeploySpec::Error at 10 levels instead, surfacing the broken configuration to the stack owner. This also removes the one case where GitObjectFileSystem's fallback was worse than not falling back: its own inherit-depth guard fell back to this previously-uncapped code path.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on #1497. Extracted from its review (thanks @timothysmith0609 for the catch).
What
build_configrecurses throughinherit_fromchains with no bound. A cycle (a.yml↔b.yml) recurses untilSystemStackError— which is not aStandardError, so it escapes every rescue in the calling jobs — or, post-#1494, hard-blocks a worker thread until the 15-minute execution cap kills it. Cap the chain at 10 levels and raise a clearDeploySpec::Errornaming the resolution path, so the broken configuration surfaces to the stack owner instead.Why it matters beyond the obvious
:disabledpath everyone runs).GitObjectFileSystem's own inherit-depth guard fell back to this previously-uncapped path, converting a cleanFallbackRequiredinto a stack overflow.10 levels is generous — observed real chains are 2–3 deep.
GitObjectFileSystem#build_configsignature updated to match (extradepthparam passed throughsuper).Tests
DeploySpec::Errorwith a clear message (previously: infinite recursion)